var e = require("../../../@babel/runtime/helpers/interopRequireDefault"), t = e(require("../../../@babel/runtime/regenerator")), n = require("../../../@babel/runtime/helpers/asyncToGenerator"), a = e(require("../../../http/system")), r = getApp(), s = new a.default();

Component({
    properties: {
        info: Object,
        selectedType: {
            type: Number,
            value: 0
        }
    },
    data: {},
    methods: {
        nothing: function() {},
        checkBoxOnTap: function(e) {
            this.setData({
                selectedType: e.currentTarget.dataset.type
            });
        },
        ruleOnTap: function() {
            var e = this;
            return n(t.default.mark(function n() {
                var a;
                return t.default.wrap(function(t) {
                    for (;;) switch (t.prev = t.next) {
                      case 0:
                        if (e.useRuleText) {
                            t.next = 18;
                            break;
                        }
                        return t.prev = 1, r.showLoading(), t.next = 5, s.getSystemConfig("IntegrationUseRule");

                      case 5:
                        a = t.sent, e.useRuleText = a.data.configValue, e.setData({
                            alertInfo: {
                                title: "使用规则",
                                content: e.useRuleText
                            }
                        }), t.next = 13;
                        break;

                      case 10:
                        t.prev = 10, t.t0 = t.catch(1), console.log(t.t0);

                      case 13:
                        return t.prev = 13, wx.hideLoading(), t.finish(13);

                      case 16:
                        t.next = 19;
                        break;

                      case 18:
                        e.setData({
                            alertInfo: {
                                title: "使用规则",
                                content: e.useRuleText
                            }
                        });

                      case 19:
                      case "end":
                        return t.stop();
                    }
                }, n, null, [ [ 1, 10, 13, 16 ] ]);
            }))();
        },
        closeOnTap: function() {
            this.setData({
                info: null
            });
        },
        sureOnTap: function() {
            0 != this.data.selectedType ? (this.triggerEvent("onConfirm", {
                selectedType: this.data.selectedType
            }), this.closeOnTap()) : r.showToast("请选择");
        }
    }
});